Padding


Padding

In the figure below, the size of the input is 8 by 8. However, the output produced by the 2D convolution has a size of 6 by 6. If we want to preserve the width and the height of the tensor when it flows through a convolutional layer, then it is necessary to pad the input so that the moving window can be placed partially outside the input tensor.
En la figura de abajo, el tamaño de la entrada es de 8 por 8. Sin embargo, la salida producida por la Convolución 2D tiene un tamaño de 6 por 6. Si usted quiere preservar el ancho y la altura del tensor cuando este fluye a través de una capa convolucional, entonces es necesario rellenar la entrada de tal forma que la ventana puede ser ubicada parcialmente afuera del tensor de entrada.

2DConvolution

Padding Size

The figure below shows how padding can be performed. The tensor at the top has no padding. The tensor in the middle has a padding of size one. The tensor at the bottom has a padding of size two. In this case, the padding was performed using zeros, however, padding can be performed with other values.
La figura de abajo muestra como el relleno puede ser realizado. El tensor en la parte de arriba no tiene relleno. El tensor de en medio tiene un relleno de tamaño uno. El tensor de abajo tiene un relleno de tamaño dos. En este caso, el relleno puede ser realizado con ceros, sin embargo, el relleno puede ser realizado con otros valores.

padding

Problem 1
A 3D Tensor with a width of 128, a height of 128 and a depth of three was produced from a RGB color image. Each color is represented using an integer value from zero to 255. This tensor is applied to a convolutional layer. If it is desired to preserve the width and the height of the tensor.
  1. Is it recommended to pad the input tensor with zeros?
  2. What value do you recommend instead for padding the input tensor?

Un Tensor 3D con un ancho de 128, una altura de 128 y una profundidad de tres se generó usando una imagen RGB de color. Cada color se representa usando un valor entero desde cero hasta 255. Este tensor se aplica a una capa convolucional. Si se desea preservar el ancho y el alto del tensor.
  1. Es recomendado rellenar con ceros el tensor de entrada?
  2. Con que valor recomienda en su lugar rellenar el tensor de entrada?

Problem 2
A 3D Tensor with a width of 128, a height of 128 and a depth of five has values in the range from −1 to 1. This tensor is applied to a convolutional layer. What value do you recommend for padding the input tensor to preserve the width and height of the sensor?
Un Tensor 3D con un ancho de 128, una altura de 128 y una profundidad de cinco tiene valores en el rango de −1 to 1. Este tensor se aplica a una capa convolucional. Con que valor recomienda rellenar el tensor de entrada para preservar el ancho y el alto del sensor?

Problem 3
A 3D Tensor has a width of 512, a height of 512 and a depth of 10. This tensor is applied to a convolutional layer with four filters. All filters in the convolutional layer have a visual field of five. If no padding is used, compute:
  1. The width of the output tensor
  2. The height of the output tensor
  3. The depth of the output tensor

Un Tensor 3D tiene un ancho de 512, una altura de 512 y una profundidad de 10. Este tensor se aplica una capa convolucional con cuatro filtros. Todos los filtros en la capa convolucional tienen un campo visual de cinco. Si no se usa el rellenado, calcule:
  1. El ancho del tensor de salida
  2. La altura del tensor de salida
  3. La profundidad del tensor de salida

Problem 4
A 3D Tensor has a width of 64, a height of 64 and a depth of 2. This tensor is applied to a convolutional layer with six filters. If the width and height of the output tensor are 54, compute the value of the visual field of the filters in the convolutional layer.
Un Tensor 3D tiene un ancho de 64, una altura de 64 y una profundidad de 2. Este tensor se aplica una capa convolucional con seis filtros. Si el ancho y la altura del tensor de salida son 54, calcule el valor del campo visual de los filtros en la capa convolucional.

Problem 5
Find an algebraic expression to compute the width of the output tensor (widthoutput) using the width of the input tensor (widthinput) the receptive field of the layer (receptivefield), the striding and the padding.
Encuentre una expresión algebraica para calcular el ancho del tensor de salida (widthoutput) usando el ancho del tensor de entrada (widthinput), el campo receptivo de la capa (receptivefield), el striding y el padding.

answer

© Copyright 2000-2021 Wintempla selo. All Rights Reserved. Jul 22 2021. Home